package com.yao.controller;

import com.yao.domain.Demo;
import com.yao.service.DemoService;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

/**
 * @author : hzyao
 * @date : 17:41 2021/7/27
 */
@RestController
@RequestMapping("/demo")
public class DemoController {
    @Resource
    private DemoService demoService;

    @GetMapping("/hello")
    public String hello() {
        return "Hello World!" ;
    }


    @GetMapping("/list")
    public List<Demo> hello1() {
        return demoService.list() ;
    }




}
